package com.school.graduation.common.base;

import android.content.Context;
import android.os.Bundle;
import android.support.annotation.Nullable;
import android.support.v4.app.Fragment;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;

import butterknife.ButterKnife;

public abstract class BaseFragment extends Fragment {

    public Context context;

    @Nullable
    @Override
    public View onCreateView(LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {
        View view =  inflater.inflate(getFragmentView(),container,false);
        ButterKnife.bind(this,view);
        context = getContext();
        initData();
        return view;
    }

    //获取到fragment需要绑定的视图id
    public abstract int getFragmentView();

    //做初始化操作
    public abstract void initData();

}
